import axios from '~/axios'

// 添加合同模板
export function addContractTemplateApi(data) {
    return axios.post('/basic/lindi/contractTemplate/addContractTemplate', data)
}

// 删除合同模板
export function deleteContractTemplateByContractTemplateIdApi(contractTemplateId) {
    return axios({
        method: 'DELETE',
        url: '/basic/lindi/contractTemplate/deleteContractTemplateByContractTemplateId',
        params: {
            contractTemplateId: contractTemplateId
        }
    })
}

// 修改合同模板
export function updateContractTemplateByContractTemplateIdApi(data) {
    return axios.put('/basic/lindi/contractTemplate/updateContractTemplateByContractTemplateId', data)
}

// 分页查询合同模板列表
export function getPageContractTemplateListApi(params) {
    return axios({
        method: 'GET',
        url: '/basic/lindi/contractTemplate/getPageContractTemplateList',
        params: params
    })
}

// 根据ID查询合同模板详情
export function getContractTemplateByContractTemplateIdApi(contractTemplateId) {
    return axios.get(`/basic/lindi/contractTemplate/getContractTemplateByContractTemplateId/${contractTemplateId}`)
}

// 根据文件ID删除合同模板文件
export function deleteContractTemplateFileByFileIdApi(fileId) {
    return axios({
        method: 'POST',
        url: '/basic/lindi/contractTemplate/deleteContractTemplateFileByFileId',
        params: {
            fileId: fileId
        }
    })
}